package com.lry.sso.service.service;

import com.lry.sso.common.exception.SysInvocationException;
import com.lry.sso.data.pojo.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class TestService {

    @Autowired
    private UserService userService;

    @Transactional
    public void t(){
        SysUser user = new SysUser();
        user.setName("11");
        user.setCreateTime(new Date());
        user.setStatus(0);
        user.setUsername("11");
        userService.insertUser(user);
        try {
            int i = 1/0;
        } catch (Exception e) {
            throw new SysInvocationException("1","1");
        }
    }


//    public void d(){
//        SysUser user = new SysUser();
//        user.setName("22");
//        user.setCreateTime(new Date());
//        user.setStatus(0);
//        user.setUsername("22");
//        userService.insertUser(user);
//        int i = 1/0;
//        SysUser suss = new SysUser();
//        suss.setName("33");
//        suss.setCreateTime(new Date());
//        suss.setStatus(0);
//        suss.setUsername("33");
//        userService.insertUser(suss);
//    }
}
